<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<script type="text/javascript">
	function editView() {
		window.location.href = "edit.htm?custId=" + ${customer.customerId};
	}

	function listAllView() {
		window.location.href = "viewAll.htm";
	}

	function deleteView() {
		if (confirm("Are you sure you want to delete this customer?")) {
			window.location.href = "delete.htm?custId=" + ${customer.customerId};
		}
	} 
</script>
<input type="button" value="Edit" onclick="editView()"/>
<input type="button" value="Delete" onclick="deleteView()"/>
<input type="button" value="Customer List" onclick="listAllView()"/>
<table>
	<tr align="left">
		<th>Customer Name</th>
		<td>${customer.customerName}</td>
	</tr>
	<tr align="left">
		<th colspan="2">Contact Person</th>
	</tr>
	<tr align="left">
		<td>Last Name</td>
		<td>${customer.contactPerson.lastName}</td>
	</tr>
	<tr align="left">
		<td>First Name</td>
		<td>${customer.contactPerson.firstName}</td>
	</tr>
	<tr align="left">
		<td>Middle Name</td>
		<td>${customer.contactPerson.middleName}</td>
	</tr>
	<tr align="left">
		<th>Landline</th>
		<td>${customer.phone}</td>
	</tr>
	<tr align="left">
		<th>Mobile</th>
		<td>${customer.mobile}</td>
	</tr>
	<tr align="left">
		<th colspan="2">Resident Address</th>
	</tr>
	<tr align="left">
		<td>Street</td>
		<td>${customer.residentAddress.street}</td>
	</tr>
	<tr align="left">
		<td>City</td>
		<td>${customer.residentAddress.city}</td>
	</tr>
	<tr align="left">
		<td>Province</td>
		<td>${customer.residentAddress.province}</td>
	</tr>
	<tr align="left">
		<td>Zip Code</td>
		<td>${customer.residentAddress.zipCode}</td>
	</tr>
</table>